package com.ruoyi.zy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zy.mapper.VmeYianMapper;
import com.ruoyi.zy.domain.VmeYian;
import com.ruoyi.zy.service.IVmeYianService;
import com.ruoyi.common.core.text.Convert;

/**
 * 医案Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-17
 */
@Service
public class VmeYianServiceImpl implements IVmeYianService 
{
    @Autowired
    private VmeYianMapper vmeYianMapper;

    /**
     * 查询医案
     * 
     * @param yianId 医案主键
     * @return 医案
     */
    @Override
    public VmeYian selectVmeYianByYianId(Long yianId)
    {
        return vmeYianMapper.selectVmeYianByYianId(yianId);
    }

    /**
     * 查询医案列表
     * 
     * @param vmeYian 医案
     * @return 医案
     */
    @Override
    public List<VmeYian> selectVmeYianList(VmeYian vmeYian)
    {
        return vmeYianMapper.selectVmeYianList(vmeYian);
    }

    /**
     * 新增医案
     * 
     * @param vmeYian 医案
     * @return 结果
     */
    @Override
    public int insertVmeYian(VmeYian vmeYian)
    {
        vmeYian.setCreateTime(DateUtils.getNowDate());
        return vmeYianMapper.insertVmeYian(vmeYian);
    }

    /**
     * 修改医案
     * 
     * @param vmeYian 医案
     * @return 结果
     */
    @Override
    public int updateVmeYian(VmeYian vmeYian)
    {
        vmeYian.setUpdateTime(DateUtils.getNowDate());
        return vmeYianMapper.updateVmeYian(vmeYian);
    }

    /**
     * 批量删除医案
     * 
     * @param yianIds 需要删除的医案主键
     * @return 结果
     */
    @Override
    public int deleteVmeYianByYianIds(String yianIds)
    {
        return vmeYianMapper.deleteVmeYianByYianIds(Convert.toStrArray(yianIds));
    }

    /**
     * 删除医案信息
     * 
     * @param yianId 医案主键
     * @return 结果
     */
    @Override
    public int deleteVmeYianByYianId(Long yianId)
    {
        return vmeYianMapper.deleteVmeYianByYianId(yianId);
    }
}
